package com.orphan.supplier.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.orphan.supplier.po.RealSupplier;
import com.orphan.supplier.po.Supplier;
import com.orphan.supplier.mapper.SupplierMapper;
import com.orphan.supplier.service.ISupplierService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.orphan.supplier.vo.BackVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jack
 * @since 2021-07-20
 */
@Service
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, RealSupplier> implements ISupplierService {

    @Autowired
    SupplierMapper supplierMapper;
    @Override
    public List<RealSupplier> getAll() {
        return supplierMapper.getAll();
    }
    @Override
    public int insert(RealSupplier realSupplier) {
        return supplierMapper.insert(realSupplier);
    }

    @Override
    public PageInfo<RealSupplier> findByItem(int pageNO) {
        PageHelper.startPage(pageNO, PAGESIZE);
        PageInfo<RealSupplier> pageInfo = PageInfo.of(supplierMapper.getAll());
        return pageInfo;
    }

    @Override
    public String check(String username) {
        return supplierMapper.check(username);
    }
}
